package com.tutorialspoint.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainApp {
	public static void main(String[] args) {
		ApplicationContext ctx = 
				new ClassPathXmlApplicationContext("Beans.xml");
		Student sdt = (Student) ctx.getBean("student");
		sdt.getName();
		sdt.getAge();
		// sdt.getSex();
		// sdt.setName("test");
		// sdt.printThrowException();
		
		ApplicationContext ctx1 = 
				new ClassPathXmlApplicationContext("Beans_anonAspect.xml");
		Student sdt1 = (Student) ctx1.getBean("student");
		sdt1.getName();
		sdt1.getAge();
		sdt1.printThrowException();
	}
}
